package com.smxy.daydayup.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.smxy.daydayup.util.tree.DataTree;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/**
 * @team daydayup
 * @time 2021-12-12 8:33
 */
@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("章节实体类")
public class SectionTree implements Serializable, DataTree<SectionTree> {

    @ApiModelProperty("章节id")
    @TableId(type = com.baomidou.mybatisplus.annotation.IdType.AUTO)
    private Long sectionId;

    @ApiModelProperty("树id")
    private Integer id;

    @ApiModelProperty("章节标题(树label)")
    private String label;

    @ApiModelProperty("父亲树id")
    private Integer parentId;

    @ApiModelProperty("章节内容")
    private String sectionContent;

    @ApiModelProperty("课程id")
    private Integer courseId;

    @ApiModelProperty("孩子树集合")
    private List<SectionTree> children;

    private static final long serialVersionUID = 1L;

    public SectionTree(Long sectionId, Integer id, String label, Integer parentId, String sectionContent, Integer courseId) {
        this.sectionId = sectionId;
        this.id = id;
        this.label = label;
        this.parentId = parentId;
        this.sectionContent = sectionContent;
        this.courseId = courseId;
    }
}